{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>编辑订单</h5>
                </div>
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">选择客户：</label>
                            <div class="layui-input-block">
                                <select name="po_client_id"  xm-select="select" xm-select-search="" xm-select-radio="" xm-select-search-type="dl" disabled>
                                    {foreach name="client" item="vo"}
                                    <option value="{$vo.pc_id}" {$vo.pc_id == $order.po_client_id ? 'selected' : ''}>{$vo.pc_client_name}--{$vo.pc_client_phone}</option>
                                    {/foreach}
                                </select>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">选择套餐：</label>
                            <div class="layui-input-block">
                                <select name="po_setmeal_id"  xm-select="select1" xm-select-search="" xm-select-radio="" xm-select-search-type="dl">
                                    {foreach name="setmeal" item="vo1"}
                                    <option value="{$vo1.ps_id}" {$vo1.ps_id == $order.po_setmeal_id ? 'selected' : ''}>{$vo1.ps_name}</option>
                                    {/foreach}
                                </select>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md10">
                            <label class="layui-form-label">皮肤图集：</label>
                            <div class="layui-input-block">
                                <input type="hidden" name="del" id="del2" value="">
                                <input type="hidden" id="hid2" value="{$order.po_images}">
                                <input type="hidden" name="po_images" id="photo2" value="{$order.po_images}">
                                <div id="uploader2" class="container-s">
                                    <div class="queueList">
                                        <div class="placeholder">
                                            <div id="filePicker2"></div>
                                            <p>或将照片拖到这里</p>
                                        </div>
                                    </div>
                                    <div class="statusBar" style="display:none;">
                                        <div class="layui-progress layui-progress-big active-s" lay-showpercent="true">
                                            <div class="layui-progress-bar layui-bg-blue" lay-percent="0%">
                                            </div>
                                            <span></span>
                                        </div>
                                        <div class="info"></div>
                                        <div class="btns">
                                            <div id="goPicker2" class="filePicker2"></div>
                                            <div class="uploadBtn">开始上传</div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md10">
                            <label class="layui-form-label">魔镜图片：</label>
                            <div class="layui-input-block">
                                <input type="hidden" name="del" id="del4" value="">
                                <input type="hidden" id="hid4" value="{$order.po_mj_images}">
                                <input type="hidden" name="po_mj_images" id="photo4" value="{$order.po_mj_images}">
                                <div id="uploader4" class="container-s">
                                    <div class="queueList">
                                        <div class="placeholder">
                                            <div id="filePicker4"></div>
                                            <p>或将照片拖到这里</p>
                                        </div>
                                    </div>
                                    <div class="statusBar" style="display:none;">
                                        <div class="layui-progress layui-progress-big active-s" lay-showpercent="true">
                                            <div class="layui-progress-bar layui-bg-blue" lay-percent="0%">
                                            </div>
                                            <span></span>
                                        </div>
                                        <div class="info"></div>
                                        <div class="btns">
                                            <div id="goPicker4" class="filePicker2"></div>
                                            <div class="uploadBtn">开始上传</div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">收货人：</label>
                            <div class="layui-input-block">
                                <input type="text" value="{$order.po_receive_username}" name="po_receive_username" placeholder="收货人" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">手机号：</label>
                            <div class="layui-input-block">
                                <input type="text" value="{$order.po_receive_phone}" name="po_receive_phone" placeholder="手机号" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md12">
                            <label class="layui-form-label">地区：</label>
                            <div class="layui-input-inline">
                                <select name="po_sheng" lay-search="" id="province" lay-filter="province">
                                    <option value="">---- 请选择省 ----</option>
                                    {foreach name="province" item="vo2"}
                                    <option value="{$vo2.district_id}" {$vo2.district_id == $order.po_sheng ? 'selected' : ''}>{$vo2.district}</option>
                                    {/foreach}
                                </select>
                            </div>

                            <div class="layui-input-inline">
                                <select name="po_shi" lay-search="" id="city" lay-filter="city">
                                    {foreach name='city' item='vo3'}
                                    <option value="{$vo3.district_id}" {$vo3.district_id == $order.po_shi ? 'selected' : ''}>{$vo3.district}</option>
                                    {/foreach}
                                </select>
                            </div>

                            <div class="layui-input-inline">
                                <select name="po_qu" lay-search="" id="district" lay-filter="district">
                                    {foreach name='district' item='vo4'}
                                    <option value="{$vo4.district_id}" {$vo4.district_id == $order.po_qu ? 'selected' : ''}>{$vo4.district}</option>
                                    {/foreach}
                                </select>
                            </div>

                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">详细地址：</label>
                            <div class="layui-input-block">
                                <input type="text" value="{$order.po_address}" name="po_address" placeholder="详细地址" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">物流单号：</label>
                            <div class="layui-input-block">
                                <input type="text" value="{$order.po_wl_number}" name="po_wl_number" placeholder="物流单号" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">物流公司：</label>
                            <div class="layui-input-block">
                                <input type="text" value="{$order.po_wl_company}" name="po_wl_company" placeholder="物流公司" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">物流备注：</label>
                            <div class="layui-input-block" style="margin-bottom: 10px">
                                <textarea style="width: 578px;height: 80px" name="po_wl_remark" placeholder="情况描述">{$order.po_wl_remark}</textarea>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md10">
                            <label class="layui-form-label">物流图片：</label>
                            <div class="layui-input-block">
                                <input type="hidden" name="del" id="del3" value="">
                                <input type="hidden" id="hid3" value="{$order.po_wl_images}">
                                <input type="hidden" name="po_wl_images" id="photo3" value="{$order.po_wl_images}">
                                <div id="uploader3" class="container-s">
                                    <div class="queueList">
                                        <div class="placeholder">
                                            <div id="filePicker3"></div>
                                            <p>或将照片拖到这里</p>
                                        </div>
                                    </div>
                                    <div class="statusBar" style="display:none;">
                                        <div class="layui-progress layui-progress-big active-s" lay-showpercent="true">
                                            <div class="layui-progress-bar layui-bg-blue" lay-percent="0%">
                                            </div>
                                            <span></span>
                                        </div>
                                        <div class="info"></div>
                                        <div class="btns">
                                            <div id="goPicker3" class="filePicker2"></div>
                                            <div class="uploadBtn">开始上传</div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">配货信息：</label>
                            <div class="layui-input-block">
                                {volist name='product' id='vo5'}
                                <input type="checkbox" name="product_ids[]" value="{$vo5.pp_id}" lay-skin="primary" title="{$vo5.pp_name}" {in name="vo5.pp_id" value="$order_product"} checked {/in}>
                                {/volist}
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">效果：</label>
                            <div class="layui-input-block">
                                <textarea style="width: 450px;height: 200px" name="po_effect">{$order.po_effect}</textarea>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">注意事项：</label>
                            <div class="layui-input-block">
                                <textarea style="width: 450px;height: 200px" name="po_remind">{$order.po_remind}</textarea>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">使用说明：</label>
                            <div class="layui-input-block">
                                <textarea style="width: 450px;height: 200px" name="po_use_explain">{$order.po_use_explain}</textarea>
                            </div>
                        </div>

                        <input type="hidden" value="{$po_id}" name="po_id">

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="component-form-element">保存
                                </button>
<!--                                <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">关闭</button>-->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}

<script>
    var n2;
    n2 = wk.uploads({num:4,type:'png,jpg,gif',attr:2,status:'update'});
    function imgDel2(e,obj,hid,del){
        wk.update_del(e,obj,hid,del,n2);
    }
    var n3;
    n3 = wk.uploads({num:5,type:'png,jpg,gif',attr:3,status:'update'});
    function imgDel3(e,obj,hid,del){
        wk.update_del(e,obj,hid,del,n3);
    }
    var n4;
    n4 = wk.uploads({num:10,type:'png,jpg,gif',attr:4,status:'update'});
    function imgDel4(e,obj,hid,del){
        wk.update_del(e,obj,hid,del,n4);
    }
    layui.use(['form','upload','layedit'], function() {
        var form = layui.form;
        form.on('submit(component-form-element)', function (data) {
            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('orderEdit')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.code == 200) {
                        layer.msg(res.msg,{icon:1,time:1500,shade:0.1},function(index){
                            wk.layer_close();
                        });
                    } else {
                        wk.error(res.msg,'','$(".layui-btn").removeClass(\'layui-disabled\').removeAttr(\'disabled\');');
                    }
                }
            })
        });
    });
</script>

</body>
</html>

